<div class="wrap">
  <div id="icon-index" class="icon32"></div>
  <h2><?php e($pageTitle) ?></h2>
  <div id="grid-wrap">
    <table id="orderlist" style="display:none"></table>
  </div>
              <div id="popup" class="abs" style="display:none;">
                <div class="rel">
                  <table id="popup_table">
                    <tbody>
                      <tr>
                        <td class="tl"></td>
                        <td class="tm"></td>
                        <td class="tr"></td>
                      </tr>
                      <tr>
                        <td class="ml"></td>
                        <td class="mm">
                          <div id="popup_content">
                            <div class="wrap fLeft"><h2 id="popup-title" style="padding-top:0;"></h2></div>
                            <div id="popup-message"></div>
                            <div id="popup-progress" class="fRight" style="visibility:hidden;"></div>
                            <div class="clear"></div>

                                <div id="sale-wrap" class="popup_content" style="display:none;">
                                  <form id="form-sale" action="<?php e($this->base); ?>/admin/sales/update" method="post" class="infotxt" onsubmit="return save()">
                                    <div class="fLeft" style="width:300px;">
                                          <table border="0" cellpadding="2" cellspacing="3" width="100%">
                                            <tbody>
                                              <tr>
                                                <td width="95" align="right" class="infotxt">&nbsp;<?php __('Order Id'); ?> :</td>
                                                <td class="infotxt"><span id="id"></span></td>
                                              </tr>
                                              <tr>
                                                <td align="right" class="infotxt">&nbsp;<?php __('User Id'); ?> :</td>
                                                <td class="infotxt"><span id="member_id"></span></td>
                                              </tr>
                                              <tr>
                                                <td align="right" class="infotxt">&nbsp;<?php __('Fullname'); ?> :</td>
                                                <td class="infotxt"><span id="fullname"></span></td>
                                              </tr>
                                              <tr>
                                                <td align="right" valign="top" class="infotxt" style="padding-top:6px;">&nbsp;<?php __('Order Content'); ?> :</td>
                                                <td class="infotxt">
                                                  <div style="overflow:auto; width:188px; height: 80px;"><span id="order_content"></span></div>
                                                </td>
                                              </tr>
                                            </tbody>
                                          </table>
                                    </div>
                                    <div class="fRight" style="width:305px; margin-left:30px;">
                                          <table border="0" cellpadding="2" cellspacing="3" width="100%">
                                            <tbody>
                                              <tr>
                                                <td align="right" class="infotxt"><span class="style16">*</span>&nbsp;<?php __('Stockist'); ?> :</td>
                                                <td class="infotxt">
                                                  <select id="stockist_id" name="stockist_id" class="select req">
                                                    <option value="">select..</option>
<?php foreach ($stockists as $key=>$value) { ?>
                                                    <option value="<?php e($key); ?>"><?php e($value); ?></option>
<?php } ?>
                                                  </select>
                                                </td>
                                              </tr>
                                              <tr>
                                                <td align="right" class="infotxt"><span class="style16">*</span>&nbsp;<?php __('Payment Type'); ?> :</td>
                                                <td class="infotxt">
                                                  <select id="payment_type" name="payment_type" class="select req">
                                                    <option value="">select..</option>
<?php foreach ($paymentType as $key=>$value) { ?>
                                                    <option value="<?php e($key); ?>"><?php e($value); ?></option>
<?php } ?>
                                                  </select>
                                                </td>
                                              </tr>
                                              <tr>
                                                <td align="right" class="infotxt"><span class="style16">*</span>&nbsp;<?php __('Payment Status'); ?> :</td>
                                                <td class="infotxt">
                                                  <select id="payment_status" name="payment_status" class="select req">
                                                    <option value="">select..</option>
<?php foreach ($paymentStatus as $key=>$value) { ?>
                                                    <option value="<?php e($key); ?>"><?php e($value); ?></option>
<?php } ?>
                                                  </select>
                                                </td>
                                              </tr>
                                              <tr>
                                                <td align="right" class="infotxt"><span class="style16">*</span>&nbsp;<?php __('Delivery Method'); ?> :</td>
                                                <td class="infotxt">
                                                  <select id="delivery_method" name="delivery_method" class="select req">
                                                    <option value="">select..</option>
<?php foreach ($deliverMethod as $key=>$value) { ?>
                                                    <option value="<?php e($key); ?>"><?php e($value); ?></option>
<?php } ?>
                                                  </select>
                                                </td>
                                              </tr>
                                              <tr>
                                                <td align="right" class="infotxt"><span class="style16">*</span>&nbsp;<?php __('Order Status'); ?> :</td>
                                                <td class="infotxt">
                                                  <select id="order_status" name="order_status" class="select req">
                                                    <option value="">select..</option>
<?php foreach ($orderStatus as $key=>$value) { ?>
                                                    <option value="<?php e($key); ?>"><?php e($value); ?></option>
<?php } ?>
                                                  </select>
                                                </td>
                                              </tr>
                                            </tbody>
                                          </table>
                                    </div>
                                    <div class="clear"></div>
                                    <div style="width:635px;">
                                          <table border="0" cellpadding="2" cellspacing="3" width="100%">
                                            <tr>
                                              <td width="95" align="right" valign="top" class="infotxt" style="padding-top:6px;">&nbsp;<?php __('Remark'); ?> :</td>
                                              <td class="infotxt">
                                                <textarea id="remark" name="remark" class="input" style="width:500px; height:75px;"></textarea>
                                              </td>
                                            </tr>
                                          </table>
                                    </div>
                                    <div class="center popupActions">
                                      <input type="hidden" id="id" name="id" value="" />
                                      <input type="submit" value="Save" />
                                      <input type="button" value="Cancel" onclick="closePopup();" />
                                    </div>
                                  </form>
                                </div>

                                <div id="update-wrap" class="popup_content" style="display:none;">
                                  <form id="form-update" action="<?php e($this->base); ?>/admin/sales/update_status" method="post" class="infotxt" onsubmit="return updateRecord2()">
                                    <div class="fLeft" style="width:300px;">
                                        <table border="0" cellpadding="2" cellspacing="3" width="100%">
                                          <tbody>
                                            <tr>
                                              <td align="right" class="infotxt">&nbsp;<?php __('Date'); ?> :</td>
                                              <td class="infotxt">
                                                <input type="hidden" id="date" name="date" />
                                                <input type="text" id="show-date" value="select.." readonly="readonly" class="date req" />
                                              </td>
                                            </tr>
                                            <tr>
                                              <td align="right" class="infotxt">&nbsp;<?php __('Time'); ?> :</td>
                                              <td class="infotxt">
                                                <input type="text" id="time" name="time" value="<?php echo date('g:i A'); ?>" readonly="readonly" class="time req" style="width:48px;" />
                                              </td>
                                            </tr>
                                          </tbody>
                                        </table>
                                    </div>
                                    <div class="fRight" style="width:305px; margin-left:30px;">
                                        <table border="0" cellpadding="2" cellspacing="3" width="100%">
                                          <tbody>
                                            <tr>
                                              <td width="133" align="right" class="infotxt">&nbsp;<?php __('Order Id'); ?> :</td>
                                              <td class="infotxt"><span id="order-ids"></span></td>
                                            </tr>
                                          </tbody>
                                        </table>
                                    </div>
                                    <div class="clear"></div>
                                    <div class="center popupActions" style="margin-top:5px;">
                                      <input type="hidden" id="update-type" />
                                      <input type="submit" value="Save" />
                                      <input type="button" value="Cancel" onclick="closePopup();" />
                                    </div>
                                  </form>
                                </div>

                          </div>
                        </td>
                        <td class="mr"></td>
                      </tr>
                      <tr>
                        <td class="bl"></td>
                        <td class="bm"></td>
                        <td class="br"></td>
                      </tr>
                    </tbody>
                  </table>
                  <div title="Close" id="popup_close" onclick="closePopup();"></div>
                </div>
              </div>
              <div id="payment-type-opt" class="abs" style="z-index:10; display:none;">
                <select id="payment-type" class="select" style="width:115px;">
<?php foreach ($paymentType as $code=>$text) { ?>
                  <option value="<?php e($code); ?>"><?php e($text); ?></option>
<?php } ?>
                </select>
              </div>
</div>

<script>
var _webroot = '<?php e($this->base); ?>';
<?php $this->addScript('Ext.onReady(function() { init(); });'); ?>
</script>